package com.hingsmy.pma.services;

import com.hingsmy.pma.dao.StudentRepository;
import com.hingsmy.pma.entities.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired
    StudentRepository studentRepository;
    public List<Student> getAll(){
        return studentRepository.findAll();

    }
    public Student save(Student student){
        return studentRepository.save(student);
    }
    public Student  findbystudentId(long theid){
        return studentRepository.findByStudentId(theid);
    }
    public void delete(Student student){
         studentRepository.delete(student);
    }

}
